package com.zhudi.model.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 用户信息表
 * @TableName user
 */
@TableName(value ="user")
@Data
public class User implements Serializable {
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @TableField(value = "user_name")
    private String userName;

    /**
     * 密码

     */
    @TableField(value = "password")
    private String password;

    /**
     * 昵称
     */
    @TableField(value = "nickname")
    private String nickname;

    /**
     * 性别
     */
    @TableField(value = "gender")
    private int gender;

    /**
     * 手机号
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 头像
     */
    @TableField(value = "avatar")
    private String avatar;

    /**
     * 身份，0表示普通用户，1表示管理员
     */
    @TableField(value = "role")
    private int role;


    /**
     * 个人简介
     */
    @TableField(value = "profile")
    private String profile;

    /**
     * 用户标签集合
     */
    private String tags;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 逻辑删除。0表示未删除，1表示已删除
     */
    @TableField(value = "is_delete")
    @TableLogic
    private int isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public User() {
    }

    public User(String username, String password) {
       this.userName = username;
       this.password=password;
    }



    public User(Long id, String userName) {
        this.id = id;
        this.userName = userName;
    }

    public User(Long id, String userName, String password, String nickname, String phone) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.nickname = nickname;
        this.phone = phone;
    }

    public User(Long id, String userName, String password, String nickname, String phone, String avatar, Integer role, String tags, Date createTime, Date updateTime, Integer isDelete) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.nickname = nickname;
        this.phone = phone;
        this.avatar = avatar;
        this.role = role;
        this.tags = tags;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.isDelete = isDelete;
    }




}